import { Dayjs } from "dayjs"

import { TimeRange } from "@/utils"

import { IMemberRiskControlNoteRecord } from "../member/types"

export interface IRiskLevelList {
	pageSize: number
	pageNum: number
	totalRecord: number
	totalPage: number
	record: IRiskLevelState[]
	summary: any
}

export interface IRiskLevelState {
	id?: string
	merchantId?: string
	windControlType?: number
	windControlLevelName?: string
	description?: string
	createdAt?: string
	createdBy?: string
	updatedAt?: string
	updatedBy?: string
}
export interface IRiskState {
	id?: string
	merchantId?: string
	windControlType?: number
	windControlLevelName?: string
	objectInfo?: string
	windControlLevel?: string
	windDescription?: string
	description?: string
	createdAt?: string
	createdBy?: string
	updatedAt?: string
	updatedBy?: string
}

export interface IQueryRiskObjectListParams {
	windControlType?: string
	windControlLevelId?: string[]
	createdBy?: string
	merchantId?: string
	createdAt?: TimeRange
	updateAt?: TimeRange
	updatedAtBegin?: string
	updatedAtEnd?: string
	pageNum?: number
	pageSize?: number
}
export interface IQueryRiskLevelListParams {
	windControlType?: string
	windControlLevelName?: string[]
	createdBy?: string
	merchantId?: string
}

export interface IQueryRiskLevelDictListParams {
	merchantId?: string
	windControlType: string
}

export interface IRiskLevelDict {
	id: string
	windControlLevelName: string
}

export interface ICommonResponse<Record, Summary = any> {
	pageSize: number
	pageNum: number
	totalRecord: number
	totalPage: number
	record: Record[]
	summary?: Summary
}

export interface IRebateStatusFreezeParams {
	exportFlag?: boolean
	pageNum?: number
	pageSize?: number
	queryCondition?: IRebateStatusQueryCondition
	summary?: boolean
}
export interface IRebateStatusQueryCondition {
	freezeAtEnd?: string
	freezeAtStart?: string
	freezeBy?: string
	freezeStatus?: number
	id?: number
	merchantId?: number
	pageNum?: number
	pageSize?: number
	parentProxyName?: number
	unfreezeAtEnd?: string
	unfreezeAtStart?: string
	unfreezeBy?: string
	userId?: number
	userName?: string
	windControlId?: number
}

export interface IRebateStatusFreezeList {
	pageNum: number
	pageSize: number
	record: IRebateStatusFreezeListRecord[]
	summary: string
	totalPage: number
	totalRecord: number
}

export interface IRebateStatusFreezeListRecord {
	accountType: number
	freezeAt: string
	freezeBy: string
	freezeRemark: string
	freezeStatus: number
	gameLockStatus: number
	id: number
	liquidationStatus: number
	loginLockStatus: number
	merchantName: string
	parentProxyName: string
	paymentLockStatus: number
	topProxyName: string
	unfreezeAt: string
	unfreezeBy: string
	unfreezeRemark: string
	userId: number
	userLabel: string
	userName: string
	windControlId: number
	windControlName: string
}

export interface IWindControlBlacklist {
	createdBy: string
	endCreatedAt: string
	ipAttribution: string
	merchantId: number
	pageNum: number
	pageSize: number
	startCreatedAt: string
	terminalInfo: string
	typeId: number
	registerTime?: TimeRange
}

export interface IMemberParams {
	id?: string
	creditLevel: number
	merchantId: string
	name: string
	mail: string
	username: string
	phoneNoPrefix?: string
	phoneNumber?: number
	phoneNum: string
	clubId: string
	userId: string
	businessModel: number
	topProxyName: string
	currency: string
	windControlType?: number
	userName: string
	phoneNo?: string
	realName?: string
	bmhUserId?: string
	riskControlNote: IMemberRiskControlNoteRecord[]
}

export interface IDxtableList {
	createdEndAt?: string
	createdStartAt?: string
	merchantId: string
	pageNum?: number
	pageSize?: number
	status?: any
	userName: string
	gameTypeId?: number
	dateRange?: any
	tableCode?: string
	registerTime?: any
	typeGameId?: string
}
export interface IAddBlackListParams {
	terminalInfo: string
	merchantId: string
	remarks?: string
}

export interface IWindControlBlacklistResponse {
	pageSize: number
	pageNum: number
	totalRecord: number
	totalPage: number
	record: IWindControlBlacklistState[]
	summary: any
}

export interface IWindControlBlacklistState {
	createdAt: string
	createdBy: string
	description: string
	id: string
	merchantId: string
	updatedAt: string
	updatedBy: string
	windControlLevelName: string
	windControlType: number
}
export interface IWindControllerLevelInfo {
	id?: string
	merchantId?: string
	merchantName?: string
	userId?: string
	username?: string
	realName?: string
	accountType?: number
	leaveLineDays?: string
	proxyName?: string
	proxyAccountType?: string
	windControllerProxyCount?: string
	levelList?: string
	cardNumber?: string
	bankName?: string
	blackStatus?: number
	bindStatus?: string
	bindNum?: string
	withdrawalTotalAmount?: string
	virtualAddress?: string
	virtualKind?: string
	virtualProtocol?: string
	registerIp?: string
	ipAttribution?: string
	deviceNo?: string
	windControlId?: string
	windControlName?: string
	windReason?: string
}

export interface ILoginIPWhitelist {
	id?: string
	merchantId?: string
	createdBy?: string
	remarks?: string
	createdAt?: string
	loginIpMember?: string
	ipAttribution?: string
}

export interface IQueryLoginIPWhitelistListParams {
	createdBy?: string
	merchantId?: string
	loginIpMember: string
	ipAttribution: string
	startCreatedAt?: string
	endCreatedAt?: string
	pageNum?: number
	pageSize?: number
}

export interface IAgentParams {
	merchantId: string
	joinCode: string
	userName: string
	userId?: string
	[k: string]: any
}

export interface IAgentState {
	isShow: boolean
	agentData: Record<string, any>
	parentData: {
		userName: string
		userId: string
		joinCode?: string
		[k: string]: any
	}
	proxyLevel: number
	examineFlag: string[]
	outlineInfo: Record<string, any>
	remarksTableData: Record<string, any>
	balanceList: Record<string, any>
	financialInforList: Record<string, any>
	teamInforList: Record<string, any>
	lonRecord: Record<string, any>
}

export interface IAgentLoginInfo {
	[k: string]: any
}

export interface IAgentAcountInfo {
	[k: string]: any
}

export interface IQueryRiskListParams {
	merchantId?: string
	terminalInfo?: string
	ipAttribution?: string
	createdAt?: TimeRange
	startCreatedAt?: TimeRange
	endCreatedAt?: TimeRange
}

export interface IQueryRiskListState {
	id: string
	merchantId: string
	terminalInfo: string
	ipAttribution: string
	memberNumber: string
	createdAt: string
	createdBy: string
	updatedAt: string
	updatedBy: string
	remarks: string
}

export interface IQueryRiskListLogsParams {
	merchantId?: string
	loginAt?: TimeRange
	startLoginAt?: string
	endLoginAt?: string
	loginUser?: string
	checkStatus?: string
	loginStatus?: string
	loginIP?: string
	filterOptions: {
		id?: string
		value?: string
	}
}

export interface IQueryRiskListLogsState {
	id: string
	loginTime: string
	loginStatus: string
	loginUser: string
	merchantId: string
	accountType: string
	loginIP: string
	locationIP: string
	loginTerminal: string
	deviceNumber: string
	loginAddress: string
	deviceVersion: string
	checkStatus: number
	remark: string
	ipRiskControlLevel: string
	deviceRiskControlLevel: string
}

export interface IQueryRiskListLogsSummary {
	totalLoginTimes?: string
	totalSuccessedTimes?: string
	totalFailedTimes?: string
}
export interface IQueryRiskListLogsState {
	id: string
	loginTime: string
	loginStatus: string
	loginUser: string
	merchantId: string
	accountType: string
	loginIP: string
	locationIP: string
	loginTerminal: string
	deviceNumber: string
	loginAddress: string
	deviceVersion: string
	checkStatus: number
	remark: string
}

export interface IMemeberLoginWhitelist {
	businessModel: number
	createdAt?: string
	createdBy?: string
	id?: string
	merchantId: string
	merchantName?: string
	remark?: string
	type: number
	updatedAt: string
	updatedBy?: string
	userId: string
	userName: string
}

export interface IQueryMemberLoginWhitelistListParams {
	businessModel?: string
	createdAt?: string
	createdAtBegin: string
	createdAtEnd: string
	createdBy?: string
	merchantId?: string
	userName?: string
	registerTime: [Dayjs, Dayjs]
}

export interface IMemberLoginWhitelist {
	id?: string
	merchantId?: string
	createdBy?: string
	remark?: string
	createdAt?: string
}
